<!DOCTYPE html>
<html>
<head>
	<title>字符新增api</title>
</head>
<body>
<script type="text/javascript">

let str = 'hello word.php';	


// 1. includes 					检查字符中是否含有某个字符
console.log(str.includes('hello'));		// true
console.log(str.includes('hello', 1));	// false


// 2. starstWith 				检查字符是否时某个字符开始
console.log(str.startsWith('hello'));


// 2. endsWith 					检查字符是否时某个字符结束
console.log(str.endsWith('php'));


// 3. padStart和padEnd
console.log(str.padStart(20, ' '));
console.log('lihao'.padStart(20, ' '));

console.log(str.padEnd(20, '-'));
console.log('lihao'.padEnd(20, '-'));


// 4. repeat 					重复赋值多次字符串
console.log(str.repeat(10));


// 5. at 						可以返回Unicode编号大于0xFFFF的字符
let haha = '𠮷';
console.log(haha.charAt(0), '𠮷'.at(0));



</script>
</body>
</html>